Skip to content

feat(search-issues): Support recommended sort - #1161

Draft
roggenkemper wants to merge 1 commit into
mainfrom
roggenkemper/feat/recommended-sort-mcp
Draft

feat(search-issues): Support recommended sort#1161
roggenkemper wants to merge 1 commit into
mainfrom
roggenkemper/feat/recommended-sort-mcp

Conversation

@roggenkemper

Copy link
Copy Markdown
Member

Adds recommended (Sentry's prioritized ranking) to the search_issues sort options — the tool enum, the embedded search-issues agent, and the listIssues API client. The issues API already accepts sort=recommended; the agent tooling just didn't expose it, so an agent couldn't ask for Sentry's default prioritized ranking.

recommended needs no client-side flag: the endpoint accepts it unconditionally (mapping to the v2 scorer internally when the org has the experimental flag).

toolDefinitions.json is hand-synced to the schema change; CI generate-definitions will confirm it matches.

@dcramer dcramer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found one project-scoping inconsistency worth addressing.

projectSlug?: string;
query?: string | null;
sortBy?: "user" | "freq" | "date" | "new";
sortBy?: "user" | "freq" | "date" | "new" | "recommended";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: recommended will not use the feature-flagged v2 scorer when projectSlug is present. listIssues() switches to the deprecated project issues endpoint below, but Sentry's recommendedrecommended_v2 mapping exists only in OrganizationGroupIndexEndpoint; ProjectGroupIndexEndpoint calls prep_search() directly. This makes the same sort behave differently for project-scoped requests. Could we use the organization issues endpoint for project-scoped searches too and pass a project filter/ID?

Add `recommended` (Sentry's prioritized ranking) to the search_issues tool
sort enum, the embedded search-issues agent, and the listIssues API client.
The issues API already accepts sort=recommended; the tools just didn't offer
it, so an agent could not ask for Sentry's default prioritized ranking.

Regenerated toolDefinitions.json is hand-synced to the schema change; CI
generate-definitions will confirm.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@roggenkemper
roggenkemper force-pushed the roggenkemper/feat/recommended-sort-mcp branch from 833663a to 4cbcd89 Compare July 21, 2026 17:58

@roggenkemper roggenkemper left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed against the latest main: no additional findings. The earlier project-scoping concern is now addressed because listIssues() consistently uses the organization issues endpoint and passes projectId as a query parameter, so recommended reaches the endpoint that performs the org-level scorer selection. The schema, agent prompt/output, generated definitions, and request passthrough coverage are aligned.

The test/typecheck/security checks passed. The failing Warden rollup is infrastructure-only: code-review and mcp-audit stopped after repeated provider-unavailable errors and reported no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants